<?php

namespace BigVideo\Other\COR;

use BigVideo\Other\COR\Handler\CEO;
use BigVideo\Other\COR\Handler\Director;
use BigVideo\Other\COR\Handler\Lead;
use BigVideo\Other\COR\Handler\Manager;
use BigVideo\Other\COR\Handler\Sales;
use BigVideo\Other\COR\Handler\VicePresident;

class HandlerFactory
{
    /**
     * 创建工厂方法
     * @return Sales
     */
    static public function createPriceHandler(){
        $sales = new Sales();
        $lead = new Lead();
        $manager = new Manager();
        $director =  new Director();
        $vicePresident = new VicePresident();
        $ceo = new CEO();

        $sales->setSuccessor($lead);
        $lead->setSuccessor($manager);
        $manager->setSuccessor($director);
        $director->setSuccessor($vicePresident);
        $vicePresident->setSuccessor($ceo);

        return $sales;
    }
}